<?php
session_start();
include_once('config.php');

if($_POST['register']=='register' && $_SESSION['start']<date('i') ){
	$fullname = trim($_POST['fullname']);
	$birth = trim($_POST['birth']);
	$company = trim($_POST['company']);
	$email = trim($_POST['email']);
	$handicap = trim($_POST['handicap']);
	$gender = trim($_POST['gender']);
	$national = trim($_POST['national']);
	$title = trim($_POST['title']);
	$phone = trim($_POST['phone']);
	$golfby = trim($_POST['golfby']);
	$golffee = trim($_POST['golffee']);
	$date = date('Y-m-d H:i:s');
	if($fullname!='' && $birth!='' && $company!='' && $email!='' && $gender!='' && $national!='' && $title!='' && $phone!='' && $golfby!='' && $golffee!=''){
		$qr = "INSERT INTO `register` VALUES ('','{$fullname}','{$birth}','{$company}','{$email}','{$handicap}','{$gender}','{$national}','{$title}','{$phone}','{$golfby}','{$golffee}','','0','{$date}','{$date}','khachhang','','0')";
		mysql_query($qr);
		$_SESSION['start'] = date('i');
		echo '1';
	}else echo '0';
}